import axios from '../axios';

export default {
    getCustomers: async () => {
        return await axios({
            url: '/customers/getCustomers',
            method: 'get'
        })
    },
    getCustomerById: async (params) => {
        return await axios({
            url: '/customers/getCustomerById',
            method: 'get',
            params: params
        })
    },
    addCustomer: async (customer) => {
        return await axios({
            url: '/customers/addCustomer',
            method: 'post',
            data: customer
        })
    },
    updateCustomer: async (customer) => {
        return await axios({
            url: '/customers/updateCustomerById',
            method: 'post',
            data: customer
        })
    },
    deleteCustomerById: async (_id) => {
        return axios({
            url: '/customers/delCustomerById',
            method: 'get',
            params: _id
        })
    }
}